package com.bolt.auth.admin.api.sys.dto;

import com.bolt.common.collection.IteratorUtil;
import com.bolt.common.reflect.ObjectUtil;
import com.bolt.common.utils.StrUtil;
import com.bolt.support.query.conditions.domain.MatchType;
import com.bolt.support.spring.jpa.annotation.Filter;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2021/1/13.
 */
@Data
public class MenuQueryCriteria {

    @Filter( type = MatchType.CN ,blurry = "title,component,permission")
    private String blurry;

    @Filter(type = MatchType.EW)
    private List<Date> createDate;

    @Filter
    private Long pid;

    @Filter(type = MatchType.NU,name = "pid")
    private Boolean pidIsNull;

    public boolean isQuery(){
        return ObjectUtil.isNotNull(pid) || StrUtil.isNotBlank(blurry)|| IteratorUtil.isNotEmpty(createDate);
    }
}

 